"use strict";
cc._RF.push(module, '36e56yx/9xBzJyjLp4Yb4w1', 'chat_msg_system_item');
// scripts/module/chat_msg_system_item.js

"use strict";

cc.Class({
    extends: cc.Component,

    properties: {
        rtTxt: cc.RichText,

        _data: null
    },

    // use this for initialization
    onLoad: function onLoad() {
        if (this._data != null) {
            this.rtTxt.string = this._data.rtContent;
            var width = this.rtTxt._linesWidth.length > 1 ? 830 : this.rtTxt._linesWidth[0];
            var height = this.rtTxt._labelHeight;
            this.node.width += width;
            this.node.height = height + 30;

            if (this.rtTxt._linesWidth.length > 1) {
                this.rtTxt.horizontalAlign = cc.TextAlignment.LEFT;
            } else {
                this.rtTxt.horizontalAlign = this._data.type;
            }
        }
    },

    //接收系统消息数据
    init: function init(data) {
        this._data = data;
    }

});

cc._RF.pop();